<template>
  <div>
    <div id="tab">
      <div class="tab-bar">
        <a
          href="javascript:;"
          @click="tab(index)"
          v-for="(item, index) in items"
          :class="{ active: index === curId }"
          v-bind:key="index"
          >{{ item.item }}</a
        >
      </div>
      <div class="nav-wrap">
        <div class="item">全城<span class="drop"></span></div>
        <div class="item">品牌<span class="drop"></span></div>
        <div class="item">特色<span class="drop"></span></div>
      </div>
      <!-- <div v-show=" index=== curId" v-for="index in curId" v-bind:key="index"> -->
      <div class="item-a" v-for="v in arr" :key="v.id" @click="fun(v.id)">
        <div class="title-block">
          <div class="title">
            <span>{{ v.name }}</span>
            <span class="price-block">
              <span class="price">{{ v.price }}</span
              ><span class="q">元起</span>
            </span>
          </div>
          <div class="location-block">
            <div class="flex">
              {{ v.address }}
            </div>
            <div class="distance">{{ v.distance }}</div>
          </div>
          <div class="label-block">
            <div class="endorse">改签</div>
            <div class="snack">小吃</div>
            <div class="vipTag">折扣卡</div>
            <div class="hallType">4D厅</div>
            <div class="hallType">巨幕厅</div>
          </div>
          <div class="discount-block"></div>
        </div>
      </div>
    </div>
  </div>
</template>
<script>
import getLink from "@/api/getLink.js";

export default {
  data() {
    return {
      curId: 0,
      items: [
        { item: "今天09月06日" },
        { item: "明天09月07日" },
        { item: "后天09月08日" },
        { item: "周四09月09日" },
        { item: "周五09月10日" },
        { item: "周六09月11日" },
        { item: "周日09月12日" },
      ],
      arr: [],
    };
  },
  mounted() {
    getLink("/apidl/movie/yy").then((res) => {
      this.arr = res.data;
    });
  },
  methods: {
    fun(Tab) {
      this.$router.push({ path: "/dzpg" ,query: { sd: Tab }});
    },
    tab(index) {
      this.curId = index;
    },
  },
};
</script>
<style scoped>
#tab {
  width: 100%;
}
.tab-bar {
  width: 100%;
  height: 1rem;
  display: flex;
  overflow-x: scroll;
}
div ::-webkit-scrollbar {
  display: none;
}
.tab-bar a {
  flex-shrink: 0;
  color: #000;
  text-align: center;
  width: 2.5rem;
  font-size: 0.35rem;
  padding-top: 0.25rem;
}
.tab-bar .active {
  color: red;
  border-bottom: 0.05rem solid;
}
.tab-con div {
  text-align: left;
  height: 100rem;
}
.nav-wrap {
  width: 100%;
  height: 0.7rem;
  display: flex;
  line-height: 0.7rem;
  background-color: #fff;
  border-bottom: 1px solid #e8e8e8;
}
.item {
  flex: 1;
  text-align: center;
  font-size: 0.25rem;
  position: relative;
  color: #666;
}
.drop {
  display: inline-block;
  position: relative;
  top: 0.04rem;
  width: 0;
  height: 0;
  margin-left: 0.1rem;
  border: 0.1rem solid transparent;
  border-top-color: #b0b0b0;
}
.item-a {
  padding: 0.13rem 0.6rem 0.33rem 0.3rem;
  background-color: #fff;
  border-bottom: 1px solid #eaeaea;
}
.title {
  width: 80%;
  padding-top: 0.25rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  height: 0.4rem;
  line-height: 0.4rem;
  font-size: 0.35rem;
  color: #000;
}
.flex {
  width: 80%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.price-block {
  padding-top: 0.12rem;
  padding-left: 0.3rem;
}
.price {
  color: #f03d37;
}
.q {
  color: #f03d37;
  font-size: 0.2rem;
}
.location-block {
  display: flex;
  justify-content: space-between;
  margin-top: 0.1rem;
  font-size: 0.25rem;
  color: #666;
}
.label-block {
  display: flex;
  height: 0.4rem;
  line-height: 0.4rem;
  margin-top: 0.1rem;
  font-size: 0.16rem;
  text-align: center;
}
.label-block div {
  margin-right: 0.2rem;
  padding: 0 0.1rem;
}
.endorse {
  color: #589daf;
  border: 1px solid #589daf;
}
.snack {
  color: #f90;
  border: 1px solid #f90;
}
.vipTag {
  color: #f90;
  border: 1px solid #f90;
}
.hallType {
  color: #589daf;
  border: 1px solid #589daf;
}
.hallType {
  color: #589daf;
  border: 1px solid #589daf;
}
.hallType {
  color: #589daf;
  border: 1px solid #589daf;
}
</style>

